package cz.najman.emdroid.connection;

import cz.najman.emdroid.listener.OnResponseDataParsedListener;

/**
 * Interface extending the functionality of the original org.apache.http.client.ResponseHandler<T>
 * @author Lukas Najman
 *
 */
public interface ResponseHandler extends org.apache.http.client.ResponseHandler<Integer> {
	
	/**
	 * Indicates if the response code is set.
	 * 
	 * @return <b>True</b> if the response code is not null, else returns <b>false</b>
	 */
	public boolean hasResponseCode();
	
	/** 
	 * @return The response code of the executed request
	 */
	public int getResponseCode();
	
	/**
	 * @return The ID of the executed request.
	 */
	public long getRequestId();
	
	/**
	 * @param requestId ID of the request
	 */	
	public void setRequestId(Long requestId);
	
	/**
	 * Registries the listener, which is fired back when the data have been parsed.
	 * @param listener
	 */
	public void registerListener(OnResponseDataParsedListener listener);
	
}
